home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Code Resources / Jims CDEFs 1.50 / CDEF Source / source / cdef3D.h < prev    next >
Encoding:
Text File  |  1995-11-08  |  2.2 KB  |  67 lines  |  [TEXT/KAHL]

  1. //------------------------- © 1994-1995 by James G. Stout --------------------------
  2. // File        : cdef3D.h
  3. // Date        : May 2, 1994
  4. // Author    : Jim Stout
  5. // Purpose    : A CDEF to implement some 3D buttons
  6. //            :
  7. //            : This CDEF supports the System 7 style gray drawing of an
  8. //            : inactive control and the useWindFont varCode.
  9. //----------------------------------------------------------------------------------
  10. #define useWindBG         0x04
  11.  
  12. #define EMBOSS    1
  13. #define NORMAL    0
  14. #define PUSHED    1
  15. #define OFF        0
  16.  
  17. #define WINBITMAP(w)        ((((WindowPeek)(w))->port).portBits)
  18. #define WINPORTRECT(w)        ((((WindowPeek)(w))->port).portRect)
  19.  
  20. enum {
  21. vDark    = 0,
  22. dark,
  23. medDark,
  24. medLight,
  25. light,
  26. vLight
  27. };
  28.             
  29. //----------------------------------------------------------------------------------
  30. //    CDEF private data
  31. //----------------------------------------------------------------------------------
  32. typedef struct {
  33. short        txFont;
  34. short        txSize;
  35. short        txFace;
  36. }CDEFData,**CDEFHandle;
  37.  
  38. //----------------------------------------------------------------------------------
  39. //    Function prototypes
  40. //----------------------------------------------------------------------------------
  41.  
  42. static void doDraw                (ControlHandle theCtl, short varCode);
  43. pascal void drawControl         (short depth, short dFlags, GDHandle theDevice, long userData);
  44.  
  45. static void drawPush            (ControlHandle theCtl, Rect *r, short varCode, Boolean inColor, 
  46.                                     short lnHt, short lnAdj);
  47.  
  48. static void getIndicatorRect    (Rect *rr, Rect *r);
  49.  
  50. static void drawCheck            (ControlHandle theCtl, Rect *r, Boolean inColor);
  51.  
  52. static void drawRadio            (ControlHandle theCtl, Rect *r, Boolean inColor, Boolean inactive);
  53.  
  54. static void do3DRadio            (ControlHandle theCtl, Rect *r);
  55.  
  56. static void drawTitle            (ControlHandle theCtl, Rect *r, short varCode, short lnHt, 
  57.                                     short lnAdj, Boolean emboss, Boolean pushed);
  58. static void getNextLine            (Str255 t, Str255 s, short num);
  59.  
  60. static void do3DPush            (ControlHandle theCtl, short varCode, Rect *r, Boolean hilite);
  61.  
  62. static void mixColor            (RGBColor *light, RGBColor *dark, short shade, RGBColor *result);
  63.  
  64. static PixMapHandle getLockedPixels    (CGrafPtr * offPort, short qdVers);
  65. static void         unlockPixels    (PixMapHandle pmHdl, short qdVers);
  66. static short         getQDVers        (void);    
  67.